package y24.m3;

import java.math.BigInteger;
import java.text.SimpleDateFormat;
import java.util.*;

public class Test18 {
    public static void main(String[] args) {
        // 创建一个Date对象，表示当前时间
        Date currentDate = new Date();
        // 创建一个SimpleDateFormat对象，用于格式化日期
        SimpleDateFormat sdf = new SimpleDateFormat("yyMMddHHmm");
        // 将Date对象格式化为字符串
        String time = sdf.format(currentDate);
        List<String> userList = new ArrayList<>();
        BigInteger nums = new BigInteger("00");
        for (int i = 0; i < 10; i++) {
            String str = String.valueOf(nums);
            if (str.length() <= 1){
                String n = "0" + str;
                str = n;
            }
            userList.add(time + nums);
            nums = nums.add(BigInteger.ONE);
        }
        int size = userList.size();
        BigInteger num = new BigInteger("00");
        for (int i = 0; i < size; i++) {
            String xuhao = userList.get(i).substring(10);
            String str = String.valueOf(num);
            if (str.length() <= 1){
                String n = "0" + str;
                str = n;
            }
            if (str.equals(xuhao))
            num = num.add(BigInteger.ONE);
        }
        System.out.println(userList);
        System.out.println(time + num);
    }
}
